﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DC2010;
using DC2010.Objects;
using DC2010.Objects.Data;
using SdlDotNet.Input;
using System.Drawing;
using DC2010.Objects.Base;

namespace DC2012
{
    public partial class CoreEditor
    {

        private void ConstructStatistics(string fps)
        {
            int deltaY = 0;
            DisplayText(920, deltaY + 280, "FPS: " + fps, txtColl);
            DisplayText(920, deltaY + 295, "Master: " + master.Count, txtColl);
            DisplayText(920, deltaY + 310, "Game interface: " + gameinterface.Count, txtColl);
            DisplayText(920, deltaY + 325, "Map: " + map.Count, txtColl);
            DisplayText(920, deltaY + 340, "Map: " + ActiveMap, txtColl);

            //relative to party.
            PartyData pd = Root.I.GameSystem.Party;
            Point pmouse = GetMapCoordinates();
            FloorInfo fi = Root.I.FloorSystem.GetInfo(ActiveMap);
            Layer l = fi.TileLayer;

            int A = pmouse.X - pd.Location.X;
            int B = -(pd.Location.Y - pmouse.Y);

            BaseObject td = Root.I.MovementSystem.GetTile(pd.Location.X, pd.Location.Y, pmouse.X - pd.Location.X,
                                          -(pd.Location.Y - pmouse.Y), Directions.North, l);

            DisplayText(920, deltaY + 370, "Tile: A:" + A + " B:" + B, txtColl);

            if ((td != null)&&(td is TileInfo))
            {
                TileInfo ddd = (TileInfo)td;
                //DisplayText(920, deltaY + 385, "Tile: " + , txtColl);
                DisplayText(210, deltaY + 580, string.Format("Tile: ({0}) {1} ", ddd.TileType.ToString(), td.Id.ToString()), txtColl);
            }


            int X = Mouse.MousePosition.X;
            int Y = Mouse.MousePosition.Y;

            if ((X > mapOriginX) && (Y > mapOriginY))
                DisplayText(920, deltaY + 355, "Coord: X: " + GetMapCoordinates().X + ", Y: " + GetMapCoordinates().Y, txtColl);

            if (selectedTile != null)
            {
                DisplayText(X + 60, Y, "Selected tile ID: " + selectedTile.Code, txtColl);

                if (!string.IsNullOrEmpty((selectedTile).Comment))
                {
                    DisplayText(X + 60, Y + 16, "" + (selectedTile).Comment, txtColl);
                }
            }
        }
    }
}
